/**
  * \page cmd_exterior Command Engine, Exterior Interface Protocols
 
This page describes the command engine exterior interface protocols between a ScatterWeb and the outside world.</p>
<p>At the lower layer, the command engine is connected to available hardware interfaces of the
ScatterWeb node. </p>

<p>Currently commands can be received and submitted through two hardware interfaces: radio and serial port.
While the radio is used for forwarding and node to node communication, the serial port is used at gateways
to allow human operators and applications access to the sensor network.</p>

\section cmd_l1_serial Serial Interface

<p>The serial interface is the main human-machine and machine-machine interface 
to the network. Input is interpreted line-wise. Lines may not contain NUL 
characters and are terminated by CR or CRLF.</p>
<p>Inbound lines are classified by the 
first character.</p>
<table class="doc">
	<caption valign="bottom">Table: Serial Interface, Inbound line classification</caption>
	<tr>
		<th>Marker</th>
		<th>Description</th>
	</tr>
	<tr>
		<td><code>&gt;</code></td>
		<td>Inbound Binary-Mode Command Request. All following characters until LF are 
		hex-encoded</td>
	</tr>
	<tr>
		<td><code>\@</code></td>
		<td>Inbound ASCII-Mode Command Request with destination address</td>
	</tr>
	<tr>
		<td>others</td>
		<td>Inbound ASCII-Mode Command Request</td>
	</tr>
</table>
<p>Outbound lines can be classified by the receiver by the the first character.</p>

<table class="doc">
		<caption valign="bottom">Table: Serial Interface, Inbound line classification</caption>
	<tr>
		<th>Marker</th>
		<th>Description</th>
	</tr>
	<tr>
		<td><code>&lt;</code></td>
		<td>Outbound Binary-Mode Command Reply. All following characters until LF are 
		hex-encoded</td>
	</tr>
	<tr>
		<td><code>[</code></td>
		<td>Outbound ASCII-Mode Command Reply</td>
	</tr>
	<tr>
		<td>others</td>
		<td>Informative ASCII output</td>
	</tr>
</table>

\subsection cmd_l1_serial_in	Inbound ASCII-Mode Command Request

<p>Inbound ASCII command requests have the following format.</p>
<table class="doc">
	<caption valign="bottom">Table: ASCII-Mode Command Request String Format</caption>
	<tr>
		<td>Forward address (optional)</td>
		<td>Command String</td>
		<td>Argument String (optional)</td>
		<td>Comment (optional)</td>
	</tr>
	<tr>
		<td><code>@(\\*|[0-9]+)\\s</code></td>
		<td><code>[a-zA-Z0-9]+</code></td>
		<td><code>\\s[^$]*</code></td>
		<td><code>\\s+#[^$]*</code></td>
	</tr>
</table>
<ul>
	<li>Multiple arguments are separated by one or 
more space (0x20) characters. The API provides functionality to handle these (:Cmd_SplitArgs, 
	:Cmd_GetNextArg).</li>
	<li>The forwared address is a node address (#netaddr_t), a star (*) may be 
	used as shortcut for the broadcast address (#NETADDR_BROADCAST).</li>
</ul>
<p>Examples:</p>
<table class="doc">
	<tr>
		<th align="left">Example</th>
		<th align="left">Destination</th>
		<th align="left">Description</th>
	</tr>
	<tr>
		<td><code>id</code></td>
		<td>directly connected node</td>
		<td>Command request with no arguments</td>
	</tr>
	<tr>
		<td><code>id 1</code></td>
		<td>directly connected node</td>
		<td>Command request with one argument</td>
	</tr>
	<tr>
		<td><code>\@* id</code></td>
		<td>all nodes in network</td>
		<td>Broadcast command request with no arguments</td>
	</tr>
	<tr>
		<td><code>\@11 echoargs 1 2 3</code></td>
		<td>11</td>
		<td>Unicast commad request with three arguments</td>
	</tr>
</table>

\subsection cmd_l1_serial_out	Outbound ASCII-Mode Command Reply

<p>Outbound ASCII-Mode command responses have the following format. If no source 
address is given, the response was sent by the connected node.</p>
<table class="doc">
		<caption valign="bottom">Table: ASCII-Mode Command Reply String Format</caption>
	<tr>
		<th>Source address (optional)</th>
		<th>Command String</th>
		<th>Argument String (optional)</th>
	</tr>
	<tr>
		<td><code>\\[[0-9]+\]\\s</code></td>
		<td><code>\\[[a-zA-Z0-9]+\\]</code></td>
		<td><code>\\s[^$]*</code></td>
	</tr>
</table>

<p>To separate multiple arguments it is good practice to separate them by one or 
more spaces (0x20). If name shall be supplied with the arguments these should be 
precede the argument.</p>
<p>Outbound responses can be sent without previous request making them unsolicited 
responses.</p>
<table width="100%" class="doc">
	<tr>
		<th align="left">Example</th>
		<th align="left">Destination</th>
		<th align="left">Description</th>
	</tr>
	<tr>
		<td><code>[id] 1</code></td>
		<td>directly connected node</td>
		<td>Command response with unnamed argument</td>
	</tr>
	<tr>
		<td><code>[11] [echoargs] A:1 B:2 C:3</code></td>
		<td>11</td>
		<td>Command response with three named arguments</td>
	</tr>
</table>


*/